package com.amado.course28Exception;

public class S08InstanceOfTest {

	public static void main(String[] args) {		
		printObjectType("abc");
		//int Integer
		printObjectType(123);
		printObjectType(true);
	}
	public static void printObjectType(Object obj){
		//obj是String类型的就返回真，否则返回假
		if(obj instanceof String){
			System.out.println(obj+" String");
		}else if(obj instanceof Integer){
			System.out.println(obj+" Integer");
		}else{
			System.out.println(obj+" other");
		}
	}
}
